package com.hctrl.mybatis.result;

import lombok.Getter;

/**
 * @author yzr
 * @date   2021/09/09
 * @description 返回状态码
 **/
public enum ResultCode {

    /**
     * 请求成功
     */
    SUCCESS(200, "SUCCESS"),
    /**
     * 请求失败
     */
    FAILED(-1008, "请求失败,详情:%s"),

    PARAM_FORMAT_ERROR(10601, "格式校验错误"),
    MESSAGE_TEMPLATE_ERROR(10800, "短信模板不存在"),
    MESSAGE_ERROR_CODE(10801, "短信验证码错误"),
    MESSAGE_SEND_OFTEN(10802, "短信获取频繁"),
    MESSAGE_SEND_EXCEED_LIMIT(10803, "当前设备已达当日短信发送上限"),
    CAPTCHA_TIMEOUT(10804, "验证码超时"),
    GRAPH_CODE_TIMEOUT(10805, "图形验证码超时"),
    GRAPH_CODE_ERROR(10806, "图形验证码错误"),
    MESSAGE_SEND(10807, "短信已发送，请稍后再试"),
    MESSAGE_NO_SEND(10808, "请发送手机验证码"),
    MESSAGE_SUCCESS_SEND(10809, "短信发送成功"),
    UNBINDING_PHONE_ERROR(10810, "解绑手机号错误"),
    BINDING_PHONE_SUCCESS(10811, "手机号绑定成功"),
    UNBINDING_PHONE_SUCCESS(10812, "手机号解绑成功");

    @Getter
    private int code;
    @Getter
    private String message;

    private ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
}

